package com.entrogy.service;

import com.entrogy.bean.ClassAttendanceEntity;
import com.entrogy.bean.GradeAttendanceTimeEntity;
import com.entrogy.bean.GradeEntity;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ClassName StudentAttendance
 * @Description
 * @Author luoxingjiang
 * @Date 2019/7/17 0017 上午 10:50
 * @Version 1.0
 **/
public interface StudentAttendanceService {

    /**
     * 获取某个年级的早上考勤时间
     * @param schoolCode
     * @param gradeId
     * @return
     */
    GradeAttendanceTimeEntity getGradeMorningAttendanceTime(Integer schoolCode, Integer gradeId);

    boolean addGradeAttendanceInfo(GradeAttendanceTimeEntity gradeAttendanceTime);

    boolean updateGradeAttendanceInfo(List<GradeAttendanceTimeEntity> gradeAttendanceTime);

    List<ClassAttendanceEntity> listClassMorningAttendanceInfo(List<Integer> classIds, Date time, Integer schoolCode);

    List<ClassAttendanceEntity> listClassNoonOrAfternoonAttendanceInfo(List<Integer> classIds, Date time, Integer schoolCode, Integer timeFrameType);

    Map<String, Object> getMorningAttendanceDetailInfo(Integer classId, Date time, Integer schoolCode, Integer gradeId);

    Map<String, Object> getNoonOrAfternoonAttendanceDetailInfo(Integer classId, Date time, Integer schoolCode, Integer timeFrameType, Integer gradeId);

    List<GradeEntity> getGradeList(Integer schoolCode);

    /**
     * 判断是否到达该时段的考勤统计时间 需要到达考勤时间才能够查看该时段的考勤记录
     * @param timeFrameType
     * @param classId
     * @param schoolCode
     * @param dynArrangeTableName
     * @param time
     * @return
     */
    boolean isArriveAttendanceTime(Integer timeFrameType, Integer classId, Integer schoolCode, String dynArrangeTableName, Date time);

    /**
     * 查询班级的考勤时间
     * @param timeFrameType
     * @param classId
     * @param schoolCode
     * @param dynArrangeTableName
     * @return
     */
    String getClassAttendanceTimeFrame(Integer timeFrameType, Integer classId, Integer schoolCode, String dynArrangeTableName);

    /**
     * 查询年级的考勤时间
     * @param timeFrameType
     * @param gradeId
     * @param schoolCode
     * @param dynArrangeTableName
     * @return
     */
    String getGradeAttendanceTimeFrame(Integer timeFrameType, Integer gradeId, Integer schoolCode, String dynArrangeTableName);

    /**
     * 判断是否到达该年级该时段的考勤统计时间 需要到达考勤时间才能够查看该时段的考勤记录
     * @param timeFrameType
     * @param gradeId
     * @param schoolCode
     * @param dynArrangeTableName
     * @param time
     * @return
     */
    boolean isArriveGradeAttendanceTime(Integer timeFrameType, Integer gradeId, Integer schoolCode, String dynArrangeTableName, Date time);
}
